/*!
\copyright  Copyright (c) 2024 - 2025 Qualcomm Technologies International, Ltd.
            All Rights Reserved.
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\defgroup   aptx_ad_mode_monitor Aptx Adaptive Mode Monitor
\ingroup    audio_domain
\brief      Monitors aptX Adaptive stream mode and acts accordingly

*/

#ifndef APTX_AD_MODE_MONITOR_H_
#define APTX_AD_MODE_MONITOR_H_

#include <audio_driver_use_case_types.h>

/*! @{ */

typedef enum
{
    aptx_ad_mode_monitor_version_none,
    aptx_ad_mode_monitor_version_common,
    aptx_ad_mode_monitor_version_r21,
    aptx_ad_mode_monitor_version_r22,  
} aptx_ad_mode_monitor_version_t;

typedef struct
{
    uint32 sample_rate;
    aptx_ad_mode_monitor_version_t version;
    unsigned is_q2q:1;
} aptx_ad_mode_monitor_setup_t;

typedef struct
{
    void (*MonitorStartInd)(const aptx_ad_mode_monitor_setup_t *config);
    void (*MonitorStopInd)(const aptx_ad_mode_monitor_setup_t *config);
    void (*SsrcUpdateInd)(const aptx_ad_mode_monitor_setup_t *config, uint16 ssrc);
} aptx_ad_mode_monitor_observer_if_t;

/*! \brief Register an observer of mode monitor
    \note Only one observer is supported currently, will panic if more attempt to register 
    \param observer The observers interface, reference MUST remain valid even after the call.
*/
void AptxAdModeMonitor_RegisterObserver(const aptx_ad_mode_monitor_observer_if_t *observer);

/*! \brief Start monitoring the mode
    \param instance The use case instance to monitor
    \param params The parameters defining what the monitor should do
*/
void AptxAdModeMonitor_Enable(audio_driver_uc_instance_uid_t instance, const aptx_ad_mode_monitor_setup_t *params);

/*! \brief Start monitoring the mode
    \param instance The use case instance to stop monitoring
*/
void AptxAdModeMonitor_Disable(audio_driver_uc_instance_uid_t instance);

/*! @} */

#endif /* APTX_AD_MODE_MONITOR_H_ */